Matrix Operations

The usual mathematical operators ( eg. +, -, *, / ) operate on matrices as well as scalars. Lets look at the various binary operations, for A binop B:
+
Does element-by-element addition of two matrices. The row and column dimensions of A and B must be the same, unless either A or B is a 1-by-1 matrix; in this case a scalar-matrix addition operation is performed.
Does element-by-element subtraction of two matrices. The row and column dimensions of both A and B must be the same, unless either A or B is a 1-by-1 matrix; in this case a scalar-matrix subtraction operation is performed.
*
Performs matrix multiplication on the two operands. The column dimension of A must match the row dimension of B, unless either A or B is a 1-by-1 matrix; in this case a scalar-matrix multiplication is performed.
/
Performs matrix ``right-division'' on it's operands. The matrix right-division (A/B) can be thought of as A*inv (B). The column dimensions of A and B must be the same. Internally right division is the same as ``left-division'' with the arguments transposed.

A/B = (BT $\displaystyle \setminus$ AT)T

The exception to this dimension rule occurs when B is a 1-by-1 matrix; in this case a matrix-scalar divide occurs.
Additionally, has several other operators that function on matrix operand(s).
.*
Performs element-by-element multiplication on it's operands. The operands must have the same row and column dimensions, unless either A or B is a 1-by-1 matrix.
./
Performs element-by-element division on it's operands. The operands must have the same row and column dimensions, unless either A or B is a 1-by-1 matrix.
$\setminus$
Performs matrix ``left-division''. Given operands A\B, matrix left division is the solution to the set of equations Ax = B. If B has several columns, then each column of x is a solution to A*x[;i] = B[;i]. The row dimensions of A and B must agree.
. $\setminus$
Performs element-by-element left-division. Element-by-element left-division is provided for symmetry, and is equivalent to B./A. The row and column dimensions of A and B must agree, unless either one is a 1-by-1 matrix.
A^B raises A to the B power. When A is a matrix, and B is an integer scalar, the operation is performed by successive multiplications. When B is not an integer, then the operation is performed using A's eigenvalues and eigenvectors. The operation is not allowed if B is a matrix.
.
A.^B raises A to the B power in an element-by-element fashion. Either A or B can be matrix or scalar. If both A and B are matrices, then the row and column dimensions must agree.
'
This unary operator performs the matrix transpose operation. A' swaps the rows and columns of A. For a matrix with complex elements a complex conjugate transpose is performed.
.'
This unary operator performs the matrix transpose operation. A.' swaps the rows and columns of A. The difference between ' and .' is only apparent when A is a complex matrix; then A.' does not perform a complex conjugate transpose.
There are several details that are very important to note: